<template>
    <div class="tab-bar">
        <div class="item" @click="changeTab(0)">
            <router-link to='/index' :class="tabIndex==0?'active':'inactive'">首页</router-link>
        </div>
        <div class="item" @click="changeTab(1)">
            <router-link to='/follow' :class="tabIndex==1?'active':'inactive'">熟人</router-link>
        </div>
        <div class="item" @click="changeTab(2)">
            <router-link to='/index' :class="tabIndex==2?'active':'inactive'">
                <img class="bottom-add-btn" src="../../static/img/bottom_icon.jpg" alt="" srcset="">
            </router-link>
        </div>
        <div class="item" @click="changeTab(3)">
            <router-link to='/index' :class="tabIndex==3?'active':'inactive'">消息</router-link>
        </div>
        <div class="item" @click="changeTab(4)">
            <router-link to='/index' :class="tabIndex==4?'active':'inactive'">我</router-link>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{
            tabIndex:0
        }
    },
    methods:{
        changeTab(index){
            this.tabIndex = index
        }
    }
}
</script>
<style scoped>
    .tab-bar{
        height: 50px;
        line-height: 50px;
        width: 100%;
        background: #000;
        position: fixed;
        left: 0;
        bottom: 0;
        color: #cccccc;
        font-size: 16px;
        display: flex;
        justify-items: center;
        z-index: 999;
    }
    .tab-bar .item {
        flex: 1;
        text-align: center;
    }
    /* .tab-bar .item span{
        padding: 10px 0;
    } */
    .tab-bar .item .active{
        color: #ffffff;
        text-decoration: none;
    }
    .tab-bar .item .inactive{
        color: #cccccc;
        text-decoration: none;
    }
    .tab-bar .item   .bottom-add-btn{
        width: 50px;
        height: 40px;
        padding: 5px;
       
    }
   
</style>